package com.cqw.commontest.thread.unit1;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-06-04 10:30
 * @Description:
 */
public class Test1 {

    public static void main(String[] args) {
        new Game().start();
        new Music().start();

        new Thread() {
            @Override
            public void run() {
                super.run();
            }
        }.start();

    }


}


class Game extends Thread {
    @Override
    public void run() {
        while (true) {
            System.out.println("打游戏");
        }
    }
}

class Music extends Thread {

    @Override
    public void run() {
        while (true) {
            System.out.println("听音乐");
        }
    }
}